package org.pearl.validation.demo.lombok;

import lombok.*;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;

/**
 * Created by TD on 2021/5/26
 */
public class Test {


    @SneakyThrows
    public static void main(String[] args) {
        var person = new Person(111, "bbb", 17, "ccc");
        val person222 ="1111111111111";
        System.out.println(person);
        System.out.println(person222);
        Person person1 = Person.builder().age(18).name("ww").personId(112).num("bbb").build();


        @Cleanup InputStreamReader sr = new InputStreamReader(new FileInputStream(new File("E:\\github\\lombok-master\\README.md")));
        int temp = 0;
        while ((temp = sr.read()) != -1) {
            System.out.print((char) temp);
        }
    }

    @Synchronized
    public static void syncCode() {
        int i = 0;
        i++;
        System.out.println(i);
    }

    @SneakyThrows
    public static void run() {
        throw new Throwable();
    }

    @Generated
    public static void test(@NonNull String name) {
        System.out.println();
    }
}
